Left Termination of the query pattern div_in_3(g, g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

div(X, s(Y), Z) :- div_s(X, Y, Z).
div_s(0, Y, 0).
div_s(s(X), Y, 0) :- lss(X, Y).
div_s(s(X), Y, s(Z)) :- ','(sub(X, Y, R), div_s(R, Y, Z)).
lss(s(X), s(Y)) :- lss(X, Y).
lss(0, s(Y)).
sub(s(X), s(Y), Z) :- sub(X, Y, Z).
sub(X, 0, X).

Queries:

div(g,g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

div_in(X, s(Y), Z) → U1(X, Y, Z, div_s_in(X, Y, Z))
div_s_in(s(X), Y, s(Z)) → U3(X, Y, Z, sub_in(X, Y, R))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U3(X, Y, Z, sub_out(X, Y, R)) → U4(X, Y, Z, div_s_in(R, Y, Z))
div_s_in(s(X), Y, 0) → U2(X, Y, lss_in(X, Y))
lss_in(0, s(Y)) → lss_out(0, s(Y))
lss_in(s(X), s(Y)) → U5(X, Y, lss_in(X, Y))
U5(X, Y, lss_out(X, Y)) → lss_out(s(X), s(Y))
U2(X, Y, lss_out(X, Y)) → div_s_out(s(X), Y, 0)
div_s_in(0, Y, 0) → div_s_out(0, Y, 0)
U4(X, Y, Z, div_s_out(R, Y, Z)) → div_s_out(s(X), Y, s(Z))
U1(X, Y, Z, div_s_out(X, Y, Z)) → div_out(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in(x1, x2, x3)  =  div_in(x1, x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
div_s_in(x1, x2, x3)  =  div_s_in(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
sub_in(x1, x2, x3)  =  sub_in(x1, x2)
0  =  0
sub_out(x1, x2, x3)  =  sub_out(x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U4(x1, x2, x3, x4)  =  U4(x4)
U2(x1, x2, x3)  =  U2(x3)
lss_in(x1, x2)  =  lss_in(x1, x2)
lss_out(x1, x2)  =  lss_out
U5(x1, x2, x3)  =  U5(x3)
div_s_out(x1, x2, x3)  =  div_s_out(x3)
div_out(x1, x2, x3)  =  div_out(x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

div_in(X, s(Y), Z) → U1(X, Y, Z, div_s_in(X, Y, Z))
div_s_in(s(X), Y, s(Z)) → U3(X, Y, Z, sub_in(X, Y, R))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U3(X, Y, Z, sub_out(X, Y, R)) → U4(X, Y, Z, div_s_in(R, Y, Z))
div_s_in(s(X), Y, 0) → U2(X, Y, lss_in(X, Y))
lss_in(0, s(Y)) → lss_out(0, s(Y))
lss_in(s(X), s(Y)) → U5(X, Y, lss_in(X, Y))
U5(X, Y, lss_out(X, Y)) → lss_out(s(X), s(Y))
U2(X, Y, lss_out(X, Y)) → div_s_out(s(X), Y, 0)
div_s_in(0, Y, 0) → div_s_out(0, Y, 0)
U4(X, Y, Z, div_s_out(R, Y, Z)) → div_s_out(s(X), Y, s(Z))
U1(X, Y, Z, div_s_out(X, Y, Z)) → div_out(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in(x1, x2, x3)  =  div_in(x1, x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
div_s_in(x1, x2, x3)  =  div_s_in(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
sub_in(x1, x2, x3)  =  sub_in(x1, x2)
0  =  0
sub_out(x1, x2, x3)  =  sub_out(x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U4(x1, x2, x3, x4)  =  U4(x4)
U2(x1, x2, x3)  =  U2(x3)
lss_in(x1, x2)  =  lss_in(x1, x2)
lss_out(x1, x2)  =  lss_out
U5(x1, x2, x3)  =  U5(x3)
div_s_out(x1, x2, x3)  =  div_s_out(x3)
div_out(x1, x2, x3)  =  div_out(x3)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

DIV_IN(X, s(Y), Z) → U11(X, Y, Z, div_s_in(X, Y, Z))
DIV_IN(X, s(Y), Z) → DIV_S_IN(X, Y, Z)
DIV_S_IN(s(X), Y, s(Z)) → U31(X, Y, Z, sub_in(X, Y, R))
DIV_S_IN(s(X), Y, s(Z)) → SUB_IN(X, Y, R)
SUB_IN(s(X), s(Y), Z) → U61(X, Y, Z, sub_in(X, Y, Z))
SUB_IN(s(X), s(Y), Z) → SUB_IN(X, Y, Z)
U31(X, Y, Z, sub_out(X, Y, R)) → U41(X, Y, Z, div_s_in(R, Y, Z))
U31(X, Y, Z, sub_out(X, Y, R)) → DIV_S_IN(R, Y, Z)
DIV_S_IN(s(X), Y, 0) → U21(X, Y, lss_in(X, Y))
DIV_S_IN(s(X), Y, 0) → LSS_IN(X, Y)
LSS_IN(s(X), s(Y)) → U51(X, Y, lss_in(X, Y))
LSS_IN(s(X), s(Y)) → LSS_IN(X, Y)

The TRS R consists of the following rules:

div_in(X, s(Y), Z) → U1(X, Y, Z, div_s_in(X, Y, Z))
div_s_in(s(X), Y, s(Z)) → U3(X, Y, Z, sub_in(X, Y, R))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U3(X, Y, Z, sub_out(X, Y, R)) → U4(X, Y, Z, div_s_in(R, Y, Z))
div_s_in(s(X), Y, 0) → U2(X, Y, lss_in(X, Y))
lss_in(0, s(Y)) → lss_out(0, s(Y))
lss_in(s(X), s(Y)) → U5(X, Y, lss_in(X, Y))
U5(X, Y, lss_out(X, Y)) → lss_out(s(X), s(Y))
U2(X, Y, lss_out(X, Y)) → div_s_out(s(X), Y, 0)
div_s_in(0, Y, 0) → div_s_out(0, Y, 0)
U4(X, Y, Z, div_s_out(R, Y, Z)) → div_s_out(s(X), Y, s(Z))
U1(X, Y, Z, div_s_out(X, Y, Z)) → div_out(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in(x1, x2, x3)  =  div_in(x1, x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
div_s_in(x1, x2, x3)  =  div_s_in(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
sub_in(x1, x2, x3)  =  sub_in(x1, x2)
0  =  0
sub_out(x1, x2, x3)  =  sub_out(x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U4(x1, x2, x3, x4)  =  U4(x4)
U2(x1, x2, x3)  =  U2(x3)
lss_in(x1, x2)  =  lss_in(x1, x2)
lss_out(x1, x2)  =  lss_out
U5(x1, x2, x3)  =  U5(x3)
div_s_out(x1, x2, x3)  =  div_s_out(x3)
div_out(x1, x2, x3)  =  div_out(x3)
LSS_IN(x1, x2)  =  LSS_IN(x1, x2)
DIV_S_IN(x1, x2, x3)  =  DIV_S_IN(x1, x2)
U51(x1, x2, x3)  =  U51(x3)
U31(x1, x2, x3, x4)  =  U31(x2, x4)
DIV_IN(x1, x2, x3)  =  DIV_IN(x1, x2)
U41(x1, x2, x3, x4)  =  U41(x4)
SUB_IN(x1, x2, x3)  =  SUB_IN(x1, x2)
U21(x1, x2, x3)  =  U21(x3)
U61(x1, x2, x3, x4)  =  U61(x4)
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

DIV_IN(X, s(Y), Z) → U11(X, Y, Z, div_s_in(X, Y, Z))
DIV_IN(X, s(Y), Z) → DIV_S_IN(X, Y, Z)
DIV_S_IN(s(X), Y, s(Z)) → U31(X, Y, Z, sub_in(X, Y, R))
DIV_S_IN(s(X), Y, s(Z)) → SUB_IN(X, Y, R)
SUB_IN(s(X), s(Y), Z) → U61(X, Y, Z, sub_in(X, Y, Z))
SUB_IN(s(X), s(Y), Z) → SUB_IN(X, Y, Z)
U31(X, Y, Z, sub_out(X, Y, R)) → U41(X, Y, Z, div_s_in(R, Y, Z))
U31(X, Y, Z, sub_out(X, Y, R)) → DIV_S_IN(R, Y, Z)
DIV_S_IN(s(X), Y, 0) → U21(X, Y, lss_in(X, Y))
DIV_S_IN(s(X), Y, 0) → LSS_IN(X, Y)
LSS_IN(s(X), s(Y)) → U51(X, Y, lss_in(X, Y))
LSS_IN(s(X), s(Y)) → LSS_IN(X, Y)

The TRS R consists of the following rules:

div_in(X, s(Y), Z) → U1(X, Y, Z, div_s_in(X, Y, Z))
div_s_in(s(X), Y, s(Z)) → U3(X, Y, Z, sub_in(X, Y, R))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U3(X, Y, Z, sub_out(X, Y, R)) → U4(X, Y, Z, div_s_in(R, Y, Z))
div_s_in(s(X), Y, 0) → U2(X, Y, lss_in(X, Y))
lss_in(0, s(Y)) → lss_out(0, s(Y))
lss_in(s(X), s(Y)) → U5(X, Y, lss_in(X, Y))
U5(X, Y, lss_out(X, Y)) → lss_out(s(X), s(Y))
U2(X, Y, lss_out(X, Y)) → div_s_out(s(X), Y, 0)
div_s_in(0, Y, 0) → div_s_out(0, Y, 0)
U4(X, Y, Z, div_s_out(R, Y, Z)) → div_s_out(s(X), Y, s(Z))
U1(X, Y, Z, div_s_out(X, Y, Z)) → div_out(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in(x1, x2, x3)  =  div_in(x1, x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
div_s_in(x1, x2, x3)  =  div_s_in(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
sub_in(x1, x2, x3)  =  sub_in(x1, x2)
0  =  0
sub_out(x1, x2, x3)  =  sub_out(x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U4(x1, x2, x3, x4)  =  U4(x4)
U2(x1, x2, x3)  =  U2(x3)
lss_in(x1, x2)  =  lss_in(x1, x2)
lss_out(x1, x2)  =  lss_out
U5(x1, x2, x3)  =  U5(x3)
div_s_out(x1, x2, x3)  =  div_s_out(x3)
div_out(x1, x2, x3)  =  div_out(x3)
LSS_IN(x1, x2)  =  LSS_IN(x1, x2)
DIV_S_IN(x1, x2, x3)  =  DIV_S_IN(x1, x2)
U51(x1, x2, x3)  =  U51(x3)
U31(x1, x2, x3, x4)  =  U31(x2, x4)
DIV_IN(x1, x2, x3)  =  DIV_IN(x1, x2)
U41(x1, x2, x3, x4)  =  U41(x4)
SUB_IN(x1, x2, x3)  =  SUB_IN(x1, x2)
U21(x1, x2, x3)  =  U21(x3)
U61(x1, x2, x3, x4)  =  U61(x4)
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 8 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LSS_IN(s(X), s(Y)) → LSS_IN(X, Y)

The TRS R consists of the following rules:

div_in(X, s(Y), Z) → U1(X, Y, Z, div_s_in(X, Y, Z))
div_s_in(s(X), Y, s(Z)) → U3(X, Y, Z, sub_in(X, Y, R))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U3(X, Y, Z, sub_out(X, Y, R)) → U4(X, Y, Z, div_s_in(R, Y, Z))
div_s_in(s(X), Y, 0) → U2(X, Y, lss_in(X, Y))
lss_in(0, s(Y)) → lss_out(0, s(Y))
lss_in(s(X), s(Y)) → U5(X, Y, lss_in(X, Y))
U5(X, Y, lss_out(X, Y)) → lss_out(s(X), s(Y))
U2(X, Y, lss_out(X, Y)) → div_s_out(s(X), Y, 0)
div_s_in(0, Y, 0) → div_s_out(0, Y, 0)
U4(X, Y, Z, div_s_out(R, Y, Z)) → div_s_out(s(X), Y, s(Z))
U1(X, Y, Z, div_s_out(X, Y, Z)) → div_out(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in(x1, x2, x3)  =  div_in(x1, x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
div_s_in(x1, x2, x3)  =  div_s_in(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
sub_in(x1, x2, x3)  =  sub_in(x1, x2)
0  =  0
sub_out(x1, x2, x3)  =  sub_out(x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U4(x1, x2, x3, x4)  =  U4(x4)
U2(x1, x2, x3)  =  U2(x3)
lss_in(x1, x2)  =  lss_in(x1, x2)
lss_out(x1, x2)  =  lss_out
U5(x1, x2, x3)  =  U5(x3)
div_s_out(x1, x2, x3)  =  div_s_out(x3)
div_out(x1, x2, x3)  =  div_out(x3)
LSS_IN(x1, x2)  =  LSS_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LSS_IN(s(X), s(Y)) → LSS_IN(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

LSS_IN(s(X), s(Y)) → LSS_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SUB_IN(s(X), s(Y), Z) → SUB_IN(X, Y, Z)

The TRS R consists of the following rules:

div_in(X, s(Y), Z) → U1(X, Y, Z, div_s_in(X, Y, Z))
div_s_in(s(X), Y, s(Z)) → U3(X, Y, Z, sub_in(X, Y, R))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U3(X, Y, Z, sub_out(X, Y, R)) → U4(X, Y, Z, div_s_in(R, Y, Z))
div_s_in(s(X), Y, 0) → U2(X, Y, lss_in(X, Y))
lss_in(0, s(Y)) → lss_out(0, s(Y))
lss_in(s(X), s(Y)) → U5(X, Y, lss_in(X, Y))
U5(X, Y, lss_out(X, Y)) → lss_out(s(X), s(Y))
U2(X, Y, lss_out(X, Y)) → div_s_out(s(X), Y, 0)
div_s_in(0, Y, 0) → div_s_out(0, Y, 0)
U4(X, Y, Z, div_s_out(R, Y, Z)) → div_s_out(s(X), Y, s(Z))
U1(X, Y, Z, div_s_out(X, Y, Z)) → div_out(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in(x1, x2, x3)  =  div_in(x1, x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
div_s_in(x1, x2, x3)  =  div_s_in(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
sub_in(x1, x2, x3)  =  sub_in(x1, x2)
0  =  0
sub_out(x1, x2, x3)  =  sub_out(x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U4(x1, x2, x3, x4)  =  U4(x4)
U2(x1, x2, x3)  =  U2(x3)
lss_in(x1, x2)  =  lss_in(x1, x2)
lss_out(x1, x2)  =  lss_out
U5(x1, x2, x3)  =  U5(x3)
div_s_out(x1, x2, x3)  =  div_s_out(x3)
div_out(x1, x2, x3)  =  div_out(x3)
SUB_IN(x1, x2, x3)  =  SUB_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SUB_IN(s(X), s(Y), Z) → SUB_IN(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
SUB_IN(x1, x2, x3)  =  SUB_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SUB_IN(s(X), s(Y)) → SUB_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

DIV_S_IN(s(X), Y, s(Z)) → U31(X, Y, Z, sub_in(X, Y, R))
U31(X, Y, Z, sub_out(X, Y, R)) → DIV_S_IN(R, Y, Z)

The TRS R consists of the following rules:

div_in(X, s(Y), Z) → U1(X, Y, Z, div_s_in(X, Y, Z))
div_s_in(s(X), Y, s(Z)) → U3(X, Y, Z, sub_in(X, Y, R))
sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)
U3(X, Y, Z, sub_out(X, Y, R)) → U4(X, Y, Z, div_s_in(R, Y, Z))
div_s_in(s(X), Y, 0) → U2(X, Y, lss_in(X, Y))
lss_in(0, s(Y)) → lss_out(0, s(Y))
lss_in(s(X), s(Y)) → U5(X, Y, lss_in(X, Y))
U5(X, Y, lss_out(X, Y)) → lss_out(s(X), s(Y))
U2(X, Y, lss_out(X, Y)) → div_s_out(s(X), Y, 0)
div_s_in(0, Y, 0) → div_s_out(0, Y, 0)
U4(X, Y, Z, div_s_out(R, Y, Z)) → div_s_out(s(X), Y, s(Z))
U1(X, Y, Z, div_s_out(X, Y, Z)) → div_out(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in(x1, x2, x3)  =  div_in(x1, x2)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
div_s_in(x1, x2, x3)  =  div_s_in(x1, x2)
U3(x1, x2, x3, x4)  =  U3(x2, x4)
sub_in(x1, x2, x3)  =  sub_in(x1, x2)
0  =  0
sub_out(x1, x2, x3)  =  sub_out(x3)
U6(x1, x2, x3, x4)  =  U6(x4)
U4(x1, x2, x3, x4)  =  U4(x4)
U2(x1, x2, x3)  =  U2(x3)
lss_in(x1, x2)  =  lss_in(x1, x2)
lss_out(x1, x2)  =  lss_out
U5(x1, x2, x3)  =  U5(x3)
div_s_out(x1, x2, x3)  =  div_s_out(x3)
div_out(x1, x2, x3)  =  div_out(x3)
DIV_S_IN(x1, x2, x3)  =  DIV_S_IN(x1, x2)
U31(x1, x2, x3, x4)  =  U31(x2, x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

DIV_S_IN(s(X), Y, s(Z)) → U31(X, Y, Z, sub_in(X, Y, R))
U31(X, Y, Z, sub_out(X, Y, R)) → DIV_S_IN(R, Y, Z)

The TRS R consists of the following rules:

sub_in(X, 0, X) → sub_out(X, 0, X)
sub_in(s(X), s(Y), Z) → U6(X, Y, Z, sub_in(X, Y, Z))
U6(X, Y, Z, sub_out(X, Y, Z)) → sub_out(s(X), s(Y), Z)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
sub_in(x1, x2, x3)  =  sub_in(x1, x2)
0  =  0
sub_out(x1, x2, x3)  =  sub_out(x3)
U6(x1, x2, x3, x4)  =  U6(x4)
DIV_S_IN(x1, x2, x3)  =  DIV_S_IN(x1, x2)
U31(x1, x2, x3, x4)  =  U31(x2, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

DIV_S_IN(s(X), Y) → U31(Y, sub_in(X, Y))
U31(Y, sub_out(R)) → DIV_S_IN(R, Y)

The TRS R consists of the following rules:

sub_in(X, 0) → sub_out(X)
sub_in(s(X), s(Y)) → U6(sub_in(X, Y))
U6(sub_out(Z)) → sub_out(Z)

The set Q consists of the following terms:

sub_in(x0, x1)
U6(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


DIV_S_IN(s(X), Y) → U31(Y, sub_in(X, Y))
The remaining pairs can at least be oriented weakly.

U31(Y, sub_out(R)) → DIV_S_IN(R, Y)
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(DIV_S_IN(x1, x2)) = x1   
POL(U31(x1, x2)) = x2   
POL(U6(x1)) = x1   
POL(s(x1)) = 1 + x1   
POL(sub_in(x1, x2)) = x1   
POL(sub_out(x1)) = x1   

The following usable rules [17] were oriented:

sub_in(X, 0) → sub_out(X)
sub_in(s(X), s(Y)) → U6(sub_in(X, Y))
U6(sub_out(Z)) → sub_out(Z)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
QDP
                            ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

U31(Y, sub_out(R)) → DIV_S_IN(R, Y)

The TRS R consists of the following rules:

sub_in(X, 0) → sub_out(X)
sub_in(s(X), s(Y)) → U6(sub_in(X, Y))
U6(sub_out(Z)) → sub_out(Z)

The set Q consists of the following terms:

sub_in(x0, x1)
U6(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 1 less node.